﻿# CMakeList.txt: Time 的 CMake 项目，在此处包括源代码并定义
# 项目特定的逻辑。
#
cmake_minimum_required (VERSION 3.8)


SET(CMAKE_PREFIX_PATH C:/Qt/Qt5.14.2/5.14.2/msvc2017_64/lib/cmake)
#list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
project(afipdflib)

add_definitions(-DWESTBULLLOGIN_LIBRARY)
add_definitions(-DQT_DEPRECATED_WARNINGS)


IF (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
#	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ")
#	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
	set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -Wl,-rpath=./")
ENDIF()


#设置自动生成moc文件，一定要设置
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_INCLUDE_CURRENT_DIR ON)


include_directories( C:/Qt/Qt5.14.2/5.14.2/msvc2017_64/include)
include_directories( C:/Qt/Qt5.14.2/5.14.2/msvc2017_64/include/QtCore)
include_directories( C:/Qt/Qt5.14.2/5.14.2/msvc2017_64/include/QtGui)
include_directories( C:/Qt/Qt5.14.2/5.14.2/msvc2017_64/include/QtConcurrent)
include_directories( C:/Qt/Qt5.14.2/5.14.2/msvc2017_64/include/QtWidgets)

link_directories(C:/Qt/Qt5.14.2/5.14.2/msvc2017_64/lib )

#查找需要的Qt库文件，最好每一个库都要写，Qt也会根据依赖关系自动添加

find_package(Qt5Core)
find_package(Qt5Gui)
find_package(Qt5Widgets)
find_package(Qt5Concurrent)

FILE(GLOB src_files
 "${CMAKE_CURRENT_SOURCE_DIR}/*.c"
)
FILE(GLOB head_files
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
)


#通过Ui文件生成对应的头文件，一定要添加
#qt5_wrap_ui(wrap_files ${ui_files})

#将ui文件和生成文件整理在一个文件夹中，非必须
#source_group("Ui" FILES ${ui_files} ${wrap_files} )

#添加资源文件
#set(rcc_files WestBullResource.qrc)



#add_library(${PROJECT_NAME} SHARED ${src_files}  ${head_files}  ${wrap_files}  )

add_library(${PROJECT_NAME}  ${src_files}  ${head_files}  ${wrap_files}  )

#TARGET_LINK_LIBRARIES(${PROJECT_NAME} WestBullMain)
#TARGET_LINK_LIBRARIES(${PROJECT_NAME} WestBullConfig)
#TARGET_LINK_LIBRARIES(${PROJECT_NAME} WestBullDataServer)



#IF (${CMAKE_BUILD_TYPE} STREQUAL  Release)
#TARGET_LINK_LIBRARIES(${PROJECT_NAME} Qt5Core)
#TARGET_LINK_LIBRARIES(${PROJECT_NAME} Qt5Gui)
#TARGET_LINK_LIBRARIES(${PROJECT_NAME} Qt5Widgets)
#ENDIF()

#IF (${CMAKE_BUILD_TYPE} STREQUAL  Debug)
#TARGET_LINK_LIBRARIES(${PROJECT_NAME} Qt5Cored)
#TARGET_LINK_LIBRARIES(${PROJECT_NAME} Qt5Guid)
#TARGET_LINK_LIBRARIES(${PROJECT_NAME} Qt5Widgetsd)
#ENDIF()
